package com.tal.warehouse.utils;

import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

/**
 * @author max
 * @version 1.0.0
 * @ClassName EnvironmentUtils.java
 * @Description TODO
 * @createTime 2021年03月28日 21:12:00
 */
@Component
public class EnvironmentUtils implements EnvironmentAware {

    private static Environment environment;

    @Override
    public void setEnvironment(Environment environment) {
        EnvironmentUtils.environment = environment;
    }

    public static String searchByKey(String key) {
        return EnvironmentUtils.environment.getProperty(key);
    }
}
